<template>
  <div class="box">
    <el-row>
      <el-col :span="6">
        <el-tree
          :data="data"
          :props="defaultProps"
          @node-click="handleNodeClick"
        ></el-tree>
      </el-col>
      <el-col :span="18"> </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {},
  data() {
    return {
      data: [
        {
          label: "仓储统计分析",
          children: [
            {
              label: "原材报表",
              children: [
                {
                  label: "原材入库报表",
                  children: [
                    {
                      id: 1,
                      label: "通用统计",
                    },
                    {
                      id: 2,
                      label: "原材入库汇总",
                    },
                  ],
                },
                {
                  label: "原材库存报表",
                  children: [
                    {
                      id: 3,
                      label: "通用统计",
                    },
                    {
                      id: 4,
                      label: "原材入库汇总",
                    },
                  ],
                },
                {
                  label: "原材盘点报表",
                  children: [
                    {
                      id: 5,
                      label: "通用统计",
                    },
                    {
                      id: 6,
                      label: "原材入库汇总",
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          label: "生产统计分析",
          children: [
            {
              label: "加工类型报表",
              children: [
                {
                  id: 7,
                  label: "通用统计",
                },
                {
                  id: 8,
                  label: "已加工完成套丝报表",
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
    };
  },
  filters: {},
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    handleNodeClick(data, node) {
      if (!node.childNodes.length) {
        console.log(data, "100000000000");
      }
    },
  },
};
</script>

<style scoped lang="scss">
.box {
  padding: 20px;
}
</style>
